﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ChessGame
{
    /// <summary>
    /// Image object
    /// </summary>
    public class Image
    {
        /// <summary>
        /// Get's the chesspiece image
        /// </summary>
        /// <param name="colour">Side colour</param>
        /// <param name="name">Name of Chesspiece</param>
        /// <returns>Image of chesspiece</returns>
        public static Bitmap GetPieceImage(string colour, string name)
        {
            if (colour == "White")
            {
                switch (name)
                {
                    case "King":
                        return ChessGame.Properties.Resources.white_king;
                    case "Queen":
                        return ChessGame.Properties.Resources.white_queen;
                    case "Rook":
                        return ChessGame.Properties.Resources.white_rook;
                    case "Bishop":
                        return ChessGame.Properties.Resources.white_bishop;
                    case "Knight":
                        return ChessGame.Properties.Resources.white_knight;
                    case "Pawn":
                        return ChessGame.Properties.Resources.white_pawn;
                    default:
                        return new Bitmap(50, 50);
                }
            }
            else if (colour == "Black")
            {
                switch (name)
                {
                    case "King":
                        return ChessGame.Properties.Resources.black_king;
                    case "Queen":
                        return ChessGame.Properties.Resources.black_queen;
                    case "Rook":
                        return ChessGame.Properties.Resources.black_rook;
                    case "Bishop":
                        return ChessGame.Properties.Resources.black_bishop;
                    case "Knight":
                        return ChessGame.Properties.Resources.black_knight;
                    case "Pawn":
                        return ChessGame.Properties.Resources.black_pawn;
                    default:
                        return new Bitmap(50, 50);
                }
            }
            else
            {
                throw new Exception("No colour");
            }
        }
    }
}
